package org.leo.myannotation;

import org.leo.myannotation.condition.ConditionalCustom;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.text.DateFormat;

// 使用自定义的条件注解
@Configuration(proxyBeanMethods = false)
public class LeoConfig {
    @Bean
    // 只有当 org.leo.starter 和 org.qlx.test 两个配置属性都存在时才生效
    @ConditionalCustom({"com.leo.starter", "com.leo.test"})
    public DateFormat dateFormat() {
        return DateFormat.getDateInstance();
    }
}
